﻿package com.netterminator.gwt.client.menu;

import com.netterminator.gwt.client.DebugConsoleCommand;


/**
 * 菜单数据。<P>
 * 所有菜单的添加都应该在此类中进行。
 * 
 * @author SI YULONG
 *
 */
public class NetTerminatorData {

	//菜单ID后缀
    private String idSuffix;

    public NetTerminatorData(String idSuffix) {
        this.idSuffix = idSuffix;
    }

    /*
     *菜单数据项 
     */
    private ExplorerTreeNode[] data;

    //生成菜单项，这里data数组为所有菜单。每个菜单应该为改数组的元数据
    private ExplorerTreeNode[] getData() {
        if (data == null) {
            data = new ExplorerTreeNode[]{
                    new CommandTreeNode("Developer Console", "debug-category", "root", "silk/bug.png", new DebugConsoleCommand(), true, idSuffix)
            };
        }
        return data;
    }

    //根据ID后缀获取菜单项数据
    public static ExplorerTreeNode[] getData(String idSuffix) {
        return new NetTerminatorData(idSuffix).getData();
    }
}
